package com.jieshen.lesson5;

import javax.swing.*;
import java.awt.*;

public class JCheckBoxDemo extends JFrame {

    public JCheckBoxDemo() {

        Container container = getContentPane();

        //多选框
        JCheckBox checkbox1 = new JCheckBox("checkbox1");
        JCheckBox checkbox2 = new JCheckBox("checkbox2");
        JCheckBox checkbox3 = new JCheckBox("checkbox3");

        container.add(checkbox1,BorderLayout.NORTH);
        container.add(checkbox2,BorderLayout.CENTER);
        container.add(checkbox3,BorderLayout.SOUTH);

        this.setVisible(true);
        setSize(500,300);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) {
        new JCheckBoxDemo();
    }
}
